﻿Public Class checkOutForm
    Dim check As Boolean = False

    Private Sub cancelBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cancelBtn.Click
        Me.Close()
    End Sub

    Private Sub checkOutForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        logoPic.Location = New System.Drawing.Point(((checkOutPanel.Width / 2) - (logoPic.Width / 2)), 3)
        checkOutPanel.Location = New System.Drawing.Point(((Me.Width / 2) - (checkOutPanel.Width / 2)), ((Me.Height / 2) - (checkOutPanel.Height / 2)))
    End Sub

    Private Sub bookingIdTxt_TextChanged(sender As System.Object, e As System.EventArgs)

    End Sub

    Private Sub checkOutBtn_Click(sender As System.Object, e As System.EventArgs) Handles checkOutBtn.Click
        Dim checkCode As New checkCode
        Dim checkout As New checkout
        check = checkCode.checkCode()
        If (bookingCodeTxt.Text.StartsWith(" ") Or bookingCodeTxt.Text = "") Then
            MessageBox.Show("A code must be entered")
        Else
            If (check = True) Then
                checkout.checkout()
                MessageBox.Show("You have been checked out.")
                mainForm.Show()
                Me.Close()
            Else
                MessageBox.Show("Check-In code does not exist")
            End If
        End If
    End Sub

    Private Sub confirmationCodeTxt_TextChanged(sender As System.Object, e As System.EventArgs) Handles bookingCodeTxt.TextChanged

    End Sub
End Class